package com.pks.autoInsurance.helper;

import java.util.List;

import com.pks.autoInsurance.dao.RegistrationDAO;
import com.pks.autoInsurance.dao.RegistrationDAOImpl;
import com.pks.autoInsurance.dto.RegistrationDto;

/**
 * Perform Administrator retated functions.
 * 
 * @author Pankaj Soni
 * 
 */
public class AdminHelper {
	/**
	 * Retrive users
	 * 
	 * @return list
	 */
	public List<RegistrationDto> getUsersList() {
		System.out.println(getClass() + "::::getUsersList::::begin");
		RegistrationDAO registrationDAO = new RegistrationDAOImpl();
		List<RegistrationDto> usersList = registrationDAO.getUsersList();
		System.out.println(getClass() + "::::getUsersList::::end");
		return usersList;
	}

	/**
	 * Retrives users list to the admin matching with criteria.
	 * 
	 * @param ssn
	 * @return List<RegistrationDto>
	 */
	public List<RegistrationDto> getUsersList(String ssn) {
		System.out.println(getClass() + "::::getUsersList::::begin");
		RegistrationDAO registrationDAO = new RegistrationDAOImpl();
		List<RegistrationDto> usersList = registrationDAO.getUsersList(ssn);
		return usersList;
	}

	/**
	 * Deletes the user.
	 * 
	 * @param ssn
	 * @return int
	 */
	public int deleteUser(String ssn) {
		System.out.println(getClass() + "::::deleteUser::::begin");
		RegistrationDAO registrationDAO = new RegistrationDAOImpl();
		return registrationDAO.deleteUser(ssn);
	}

}
